package com.kuang.pojo;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class StudentTest01 {
    @Test
    public void test01(){
        ApplicationContext context = new ClassPathXmlApplicationContext("application.xml");
        Student name = (Student) context.getBean("name");
        System.out.println(name);
    }
    @Test
    public void test02(){
        ApplicationContext context = new ClassPathXmlApplicationContext("application.xml");
       Student student = (Student) context.getBean("student");
        System.out.println(student);
    }
    @Test
    public void test03(){
        ApplicationContext context = new ClassPathXmlApplicationContext("application.xml");
       User name = context.getBean("user",User.class);
        User names = context.getBean("user",User.class);
        System.out.println(name.hashCode());//942518407
        System.out.println(names.hashCode());//942518407
        System.out.println(name);
    }
    @Test
    public void test04(){
       ApplicationContext context = new ClassPathXmlApplicationContext("application.xml");
        User user1 = context.getBean("user1",User.class);
        User user1c = context.getBean("user1",User.class);
        System.out.println(user1.hashCode());//1943325854
        System.out.println(user1c.hashCode());//134310351
        System.out.println(user1);
    }
}
